Skip to content

html.elements.input.type_date - min/max attributes not supported in Safari iOS #26656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
stewest opened this issue Apr 28, 2025 · 2 comments
Open
Labels
data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML p4 Low priority – Community PRs accepted.

Comments

@stewest
Copy link

stewest commented Apr 28, 2025

What type of issue is this?

Incorrect support data (example: BrowserX says "86" but support was added in "40")

What information was incorrect, unhelpful, or incomplete?

Not all the attributes, like min and max are supported.

What browsers does this problem apply to, if applicable?

Safari

What did you expect to see?

Partial support would be a better display for the input type date.

Did you test this? If so, how?

We've developed a JS date picker, but iPhones still pop up their native iOS picker. Our date input fields have a correctly formatted min and max date values, but the iOS date picker doesn't show the dates as greyed out, as in other desktop browsers.

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

https://bugs.webkit.org/show_bug.cgi?id=223128 bug since 2021

and https://stackoverflow.com/questions/26929297/html-5-input-type-date-control-max-date-is-not-working-in-iphone-ipad

Do you have anything more you want to share?

No. Thank you

MDN URL

https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/date

MDN metadata

MDN page report details
  • Query: html.elements.input.type_date
  • Report started: 2025-04-28T21:51:23.811Z
@stewest stewest added the needs triage This issue needs to be confirmed label Apr 28, 2025
@github-actions github-actions bot added the data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML label Apr 28, 2025
@caugner caugner changed the title html.elements.input.type_date - min max attributes are not supported in Safari (and other browsers) on iOS html.elements.input.type_date - min/max attributes not supported in Safari iOS May 9, 2025
@caugner
Copy link
Contributor

caugner commented May 9, 2025

With this MDN Playground (and this JSBin), I can confirm that min/max on an <input type="date"> don't prevent dates outside of that range from being selected in Safari iOS 18.4, Safari iOS 11, and Safari iOS 6 (via BrowserStack Live). However, these version do use the min/max values to determine the validity of the element (see this JSBin).

On Desktop, Safari 14.1 (the first version to support <input type="date"> it there), and Safari 18.4 also use min / max to prevent dates outside of that range from being selected. And Safari 18.4 (and not yet in Safari 14.1 to Safari 17.3) additionally grays out the disallowed dates.

Note that the spec does not appear to require these behaviors, so even though you may be used to those effects of setting min/max, it would be wrong to mark Safari's support as partial in BCD.

I'm closing this as won't fix, but I will bring this up in the next internal BCD meeting.

@caugner caugner closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2025
@caugner caugner added meeting agenda Issues or pull requests in need of discussion in a project meeting. and removed needs triage This issue needs to be confirmed labels May 9, 2025
@caugner
Copy link
Contributor

caugner commented May 14, 2025

I'm closing this as won't fix, but I will bring this up in the next internal BCD meeting.

We discussed this in yesterday's BCD meeting, and came to the conclusion that a non-standard behavioral sub-feature could make sense here, so I'm reopening the issue.

Given that this affects not only min/max, but also step on <input type="date">, it would probably make sense to add this as a sub-feature of html.elements.input.type_date in this file, for example:

{
  "disables_invalid_values_in_picker_ui": {
    "__compat": {
      "description": "Disables invalid values in picker UI",
      "support": {
        // chrome, firefox, safari with `version_added: "…"`
        // safari_ios with `version_added: false`
      },
      "status": {
        "experimental": false,
        "standard_track": false,
        "deprecated": false
     }
  }
}

@stewest Would you like to open a PR that adds this sub-feature to BCD?

@caugner caugner reopened this May 14, 2025
@caugner caugner added p4 Low priority – Community PRs accepted. and removed meeting agenda Issues or pull requests in need of discussion in a project meeting. labels May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML p4 Low priority – Community PRs accepted.
Projects
None yet
Development

No branches or pull requests

2 participants